const path = require("path");
const merge = require("webpack-merge");
const base = require("./webpack.base");

module.exports = merge(
  {
    mode: "development",
    devtool: "#cheap-module-eval-source-map",
    devServer: {
      progress: true,
      contentBase: path.join(__dirname, "../dist"),
      // 允许开发服务器访问本地服务器的包JSON文件，防止跨域
      headers: {
        "Access-Control-Allow-Origin": "*",
      },
      hot: true, // 热更新
      compress: true, // 压缩
      open: true, // 自动打开
      stats: "errors-only",
      inline: true,
      // noInfo: true,
    },
  },
  base
);
